function initPage(baseInfoJson,infusionBloodInfoJson){
	var basePath = $("#basePath").val();
	var bloodTypes = baseInfoJson['bloodTypes'];//ABO血型
	$("select").each(function(){
		$(this).append("<option value=''>---请选择---</option>");
	});
	
	$(".bloodType").each(function(){
		var options = "";
		for(var index in bloodTypes){
			var bloodType = bloodTypes[index];
	    	options+="<option value='"+bloodType.uniq_code+"'>"+bloodType.label+"</option>"
	    } 
       $(this).append(options);
	});
	
	var infusionBloodRecords = infusionBloodInfoJson['infusionBloodRecords'];//转科记录集合
	for(var index in infusionBloodRecords){
		var infusionBloodRecord = infusionBloodRecords[index];
		var add_content= addInfusionBloodRecord();
		add_content.find("input[name$='.infusionBloodDateTime']").val(infusionBloodRecord.infusionBloodDateTime);
		if(infusionBloodRecord.bloodTypeCode){
			var selectOption = add_content.find("select[name$='bloodTypeCode']").find("option[value='"+infusionBloodRecord.bloodTypeCode+"']")
			if(selectOption.length > 0){
				selectOption.attr("selected",true);
			}else{
				add_content.find("select[name$='bloodTypeCode']").append("<option selected='selected' value='"+infusionBloodRecord.bloodTypeCode+"'>"+infusionBloodRecord.bloodTypeName+"</option>");
			}
			
		};
		add_content.find("input[name$='.bloodTypeName']").val(infusionBloodRecord.bloodTypeName);
		var bloodElements = infusionBloodRecord.bloodElements
		for(var index in bloodElements){
			var bloodElement = bloodElements[index];
			var bloodElementObj = add_content.find("input[value='"+bloodElement.bloodElementName+"']");
			bloodElementObj.nextAll("input[name$='bloodElementVolume']").val(bloodElement.bloodElementVolume);
			
	    } 
	} 
	
	
	
	if($("#infusionBloodRecords tbody tr").length <1){
		addInfusionBloodRecord();
	}
}

function addInfusionBloodRecord(){
	var basePath = $("#basePath").val();
	var infusionBloodCountOjb = $("#infusionBloodRecordCount");
	var count = parseInt(infusionBloodCountOjb.val());
	var add_content=$("#templateInfusionBloodTr").clone();
	add_content.removeAttr("id");
	
	add_content.find("input[name^='infusionBloodRecords[0].']").each(function(){
		var eventObj = $(this);
		eventObj.attr("name",eventObj.attr("name").replace("infusionBloodRecords[0]", "infusionBloodRecords["+count+"]"));
   		
	});
	
	add_content.find("select[name^='infusionBloodRecords[0].']").each(function(){
		var eventObj = $(this);
		eventObj.attr("name",eventObj.attr("name").replace("infusionBloodRecords[0]", "infusionBloodRecords["+count+"]"));
	});
	
	add_content.find("select[class='bloodType']").each(function(){
		$(this).change(function(){
	   		var eventObj = $(this);
	   		var nameObjName = eventObj.attr("name").replace("Code", "Name");
	   		
	   		if(eventObj.val()!=""){
	   			var name=eventObj.find("option:selected").text();
	   			eventObj.next("input[name='"+nameObjName+"']").val(name);
	   		}else{
	   			eventObj.next("input[name='"+nameObjName+"']").val("");
	   		}
	   	});
	});
	
	
	$("#infusionBloodRecords tbody").append(add_content);
	infusionBloodCountOjb.val(count +1);
	return add_content;
}

function deleteInfusionBloodRecord(obj){
	$(obj).parent().parent().remove();
}